close all;

[p, a] = meshgrid(mdp.x_range(1):0.01:mdp.x_range(2),mdp.y_range(1):0.01:mdp.y_range(2));
[ind_x, ind_y] = size(p);
z = zeros(ind_x, ind_y);

for k=1:3
    figure;
    for i=1:ind_x
        for j=1:ind_y
            sf = getFactors(t, [x(i,j) y(i,j)]);
            z(i,j) = sf*w(k,:)';
        end
    end
    set(gcf,'renderer','painters');
    mesh(x,y,z,'EdgeColor','black');
    
    xlabel('Posicion X');
    ylabel('Velocidad');
    zlabel('funcion de valor');
    
    title(['accion ' num2str(k)])
end
